package edu.ubb.remeye.security.manager.none;

import org.apache.mina.core.session.IoSession;

import edu.ubb.remeye.communication.message.Message;
import edu.ubb.remeye.security.manager.AbstractClientSecurity;

/**
 * Client authentication class for none security.
 * 
 * @author Andrew Ianicicau
 *
 */
public class ClientNoneAuthenticator extends AbstractClientSecurity {
	
	///////////////////////////////////////////////////////////////////////////////////
	////	CONSTRUCTORS - ClientNoneAuthenticator
	///////////////////////////////////////////////////////////////////////////////////
	
	public ClientNoneAuthenticator(IoSession session) {
		this.session = session;
	}

	
	
	///////////////////////////////////////////////////////////////////////////////////
	////	METHODS - ClientNoneAuthenticator
	///////////////////////////////////////////////////////////////////////////////////

	/**
	 * Authentication.
	 */
	@Override
	public void run() {
		authenticate();
	}
	
	/**
	 * Client side authentication algorithm.
	 */
	private void authenticate() {
		// setting session attribute for showing end of authentication
		authenticated();
	}
	
	/**
	 * No need for message forwarding.
	 */
	@Override
	public void forwardMessage(Message message) {
		// no message needed
	}

}
